<template>
	<view class="bg-white p-2">
		<web-view v-if="type=='URL'" :src="content"></web-view>
		<mp-html v-if="type=='HTML'" :show-img-menu="false" :content="content" />
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				type:"",
				content:"",
			}
		},
		onLoad(param) {
			this.type = param.type
			if(param.type == 'URL'){
				this.content = decodeURIComponent(param.content)
				if(param.title){
					uni.setNavigationBarTitle({
						title:param.title
					})
				}
			}else if(param.type == 'HTML'){
				this.content = decodeURIComponent(param.content)
				if(param.title){
					uni.setNavigationBarTitle({
						title:param.title
					})
				}
			}else if(param.type == 'CONFIG'){
				this.param.type = 'HTML'
				uni.$api.configByType(param.content).then(data=>{
					this.content = JSON.parse(data.value).content
					if(param.title){
						uni.setNavigationBarTitle({
							title:param.title
						})
					}
				})
			}
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
